package com.amos.base.entity;

import lombok.Data;

import javax.persistence.*;
import java.util.Date;
import java.util.List;
@Entity
@Table(name = "user", schema = "amos", catalog = "")
@Data
public class UserEntity extends BaseEntity{
    private String usernmae;
    private String password;

    private Date birthDate;
    @ManyToMany(cascade = CascadeType.ALL,fetch = FetchType.LAZY)
    @JoinTable(name = "user_role",joinColumns = @JoinColumn(name="user_id",referencedColumnName = "id"),
            inverseJoinColumns = @JoinColumn(name = "role_id",referencedColumnName = "id"))
    private List<RoleEntity> list;


}
